/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

    // 此处的字符是自己设定的cookie加密码
  config.keys = appInfo.name + '_1572788298838_9408';

    // 添加 view 配置，nunjucks是一个用来在服务器端渲染HTML的插件，用npm 安装即可
    config.view = {
        defaultViewEngine: 'nunjucks',
        mapping: {
            '.html': 'nunjucks',
        },
    };
    // add your middleware config here
  config.middleware = [];

  config.cluster = {
    listen: {
        path: '',
        port: 8006,
        hostname: '127.0.0.1',
    }
};
  config.security= {
        csrf: {
            enable: false,
        },
    };
    config.bodyParser={//解除大小
        jsonLimit: '1000mb',
        formLimit: '1024mb',
    };

    config.multipart = {
        // mode: 'file',
        fields: 500,//表单上传字段限制的个数
        fileSize: '1024mb',//文件上传的大小限制
        files:200,
        fileExtensions: [ '.docx','.rar' ,'.ai']
    };

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  config.mongoose = {
    url: process.env.EGG_MONGODB_URL || 'mongodb://127.0.0.1/test',
    options: {

    },
};
    // config.alinode = {
    //     appid: '<YOUR_APPID>',
    //     secret: '<YOUR_SECRET>',
    // };

  return {
    ...config,
    ...userConfig,
  };
};
